package com.jerry.db.util;


import com.jerry.frame.uniqueKey.SequenceFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

public class InstantiationTracingBeanPostProcessor implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
//需要执行的逻辑代码，当spring容器初始化完成后就会执行该方法。
        if(event.getApplicationContext().getParent() == null){//root application context 没有parent，他就是老大.
          SequenceFactory sequenceFactory = (SequenceFactory) event.getApplicationContext().getBean("sequenceFactory");
//            sequenceFactory.
//            sequenceFactory.set("uniCode",uniCode);
        }
    }
}